package com.limit.aspect;

import com.limit.annotation.SlidingWindowLimit;
import com.limit.aspect.core.AnnotationAspectTemplate;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

import java.lang.annotation.Annotation;

/**
 * @title: SlidingWindowLimitAspect
 * @Author xu-xiang
 * @Date: 2024-3-28 11:26:40
 * @description: 限流aop-滑动窗口限流
 */
@Aspect
public class SlidingWindowLimitAspect extends AnnotationAspectTemplate {

    @Override
    @Pointcut("@annotation(com.limit.annotation.SlidingWindowLimit) || @within(com.limit.annotation.SlidingWindowLimit)")
    public void pointcut() {
    }

    @Override
    public Class<? extends Annotation> pointcutAnnotationClass() {
        return SlidingWindowLimit.class;
    }
}
